package com.itheima.health.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.health.dao.RoleDao;
import com.itheima.health.pojo.Role;
import com.itheima.health.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author ：w
 * @date ：Created in 2019/7/28 0028
 * @description ：角色实现类
 * @version: 1.0
 */
@Service
@Slf4j
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleDao roleDao;
    @Override
    public List<Role> findAll() {
        return roleDao.findAll();
    }

    @Override
    public List<Integer> findRoleIdsByUserId(Integer userId) {
        List<Integer> roleIds = roleDao.findRoleIdsByUserId(userId);
        log.debug("<<<<<<<<<<roleIds:{}"+roleIds);
        return roleIds;
    }
}
